package com.thx.tags;

import com.opensymphony.xwork2.util.ValueStack;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 权限标签.
 * 
 * @author shiyan
 */
public class PrivilegedTag extends ComponentTagSupport {
  private static final long serialVersionUID = -2938492506647851819L;

  private String id;

  private String idName;

  private String priviType;


  @Override
  public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
    return new Privileged(stack, req);
  }

  protected void populateParams() {
    super.populateParams();
    Privileged privileged = (Privileged) component;
    privileged.setId(id);
    privileged.setIdName(idName);
    privileged.setPriviType(priviType);
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getIdName() {
    return idName;
  }

  public void setIdName(String idName) {
    this.idName = idName;
  }

  public String getPriviType() {
    return priviType;
  }

  public void setPriviType(String priviType) {
    this.priviType = priviType;
  }
}
